package com.zfei.gfb.request;

import cn.hutool.core.lang.Validator;
import com.zfei.gfb.bean.Const;
import com.zfei.gfb.bean.Status;
import com.zfei.gfb.bean.StatusException;
import com.zfei.gfb.util.ObjUtil;
import io.swagger.annotations.ApiModelProperty;


/**
 * @author fgh
 */
public class GfbLandPublicityEditRequest {

    // id
    @ApiModelProperty(value = "id", required = true)
    private Integer id;
    // 土地名称
    @ApiModelProperty(value = "土地名称", required = true)
    private String name;
    // 联系电话
    @ApiModelProperty(value = "联系电话", required = true)
    private String phone;
    // 公示开始时间
    @ApiModelProperty(value = "公示开始时间", required = true)
    private Long begin;
    // 公示结束时间
    @ApiModelProperty(value = "公示结束时间", required = true)
    private Long end;
    // 公示内容
    @ApiModelProperty(value = "公示内容", required = true)
    private String content;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public void setName(String value) {
        this.name = value;
    }

    public String getName() {
        return this.name;
    }

    public void setPhone(String value) {
        this.phone = value;
    }

    public String getPhone() {
        return this.phone;
    }

    public void setBegin(Long value) {
        this.begin = value;
    }

    public Long getBegin() {
        return this.begin;
    }

    public void setEnd(Long value) {
        this.end = value;
    }

    public Long getEnd() {
        return this.end;
    }

    public void setContent(String value) {
        this.content = value;
    }

    public String getContent() {
        return this.content;
    }

    public void checkUpdateNull() {
        if (ObjUtil.anyNull(id, name, phone, begin, end, content)) {
            throw new StatusException(Status.INVALID_ARGUMENT);
        }
//        if(!Validator.isMobile(phone)){
//            throw new StatusException(Status.INVALID_ARGUMENT);
//        }
        if(begin > end){
            throw new StatusException(Status.INVALID_ARGUMENT);
        }
    }
}

